# 求1+2!+3!+...+20!的和。


def f(n):
    if n == 1:
        return 1
    return n * f(n - 1)


s = 0

for i in range(1, 21):
    s = s + f(i)

print(s)
